Skip to content

Conversation

@badandbest
Copy link
Contributor

@badandbest badandbest commented Jan 9, 2026

Bug

Custom component editors only work if the type is an exact match. It has no support for derived component types.

Facepunch/sbox-issues#9822

Fix

I've made it use a simple scoring system to find the best editor.

The score given is based on the inheritance distance with exact matches being the best.

It also now supports interfaces as targets.

@handsomematt handsomematt requested a review from Copilot January 12, 2026 18:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where custom component editors only worked with exact type matches and did not support derived types or interfaces. The fix implements a scoring system based on inheritance distance to select the most appropriate editor, with exact matches receiving the best score.

Changes:

  • Introduced a scoring system to match component editors based on type inheritance hierarchy
  • Added support for derived component types and interfaces
  • Changed editor selection from exact name matching to inheritance-based scoring

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@handsomematt handsomematt added the triaged triaged pull-requests are replicated on the internal sbox repo label Jan 13, 2026
@sboxbot
Copy link
Contributor

sboxbot commented Jan 13, 2026

This PR has been merged upstream.

@sboxbot sboxbot added the accepted this pull request was accepted, hurrah! label Jan 13, 2026
@sboxbot sboxbot closed this Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted this pull request was accepted, hurrah! triaged triaged pull-requests are replicated on the internal sbox repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants